FROM centos:centos7
RUN curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo && \
    yum -y install python36 python36-setuptools python36-pip && \
    yum clean all && \
    pip3 install pip --upgrade -i https://mirrors.aliyun.com/pypi/simple/ && \
    /usr/local/bin/pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
    /usr/local/bin/pip3 install ansible paramiko && \
    mkdir /opt/ansible_project/etc/ansible -p && \
    ln -s /opt/ansible_project/etc/ansible/ /etc/ansible
VOLUME /opt/ansible_project
CMD ["ansible", "--version"]
# TODO 实现用easy_install 安装pip
# pip 安装后用下面的命令设置使用阿里源
# pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
# TODO 加基础镜像的基础上安装中文支持
# 官方镜像不支持中文，要另外安装和设置解决中文问题，具体可以参考下面的连接：
# https://cloud.tencent.com/developer/article/1435512
# 需要在Dockerfile中再加入下面这些：
# RUN yum install kde-l10n-Chinese -y
# RUN yum install glibc-common -y
# RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
# RUN export LANG=zh_CN.UTF-8
# RUN echo "export LANG=zh_CN.UTF-8" >> /etc/locale.conf
# ENV LANG zh_CN.UTF-8
# ENV LC_ALL zh_CN.UTF-8
# 以上内容还未测试